Skip to content

Add bamjs BAM file viewer#88

Draft
dannon wants to merge 25 commits intomainfrom
bamjs
Draft

Add bamjs BAM file viewer#88
dannon wants to merge 25 commits intomainfrom
bamjs

Conversation

@dannon
Copy link
Copy Markdown
Member

@dannon dannon commented Jun 16, 2025

Summary

Client-side BAM file viewer for Galaxy using @gmod/bam. Displays BAM headers and alignment records in a plaintext format -- useful for quick inspection of BAM files without needing a full genome browser.

  • Parses and displays BAM headers (version, sort order, reference sequences, read groups, programs)
  • Fetches and formats alignment records (name, ref, position, CIGAR, sequence, quality, flags, MAPQ, tags)
  • Smart region fallback: scans chromosomes with index data first, tries multiple regions, falls back to broader searches
  • Small file optimization: downloads BAM+BAI entirely for files <100KB, uses blob URLs with RemoteFile
  • Configurable via Galaxy XML settings: max records (1-1000), region start/end positions

xref galaxyproject/galaxy#20338

Notes

Test plan

  • CI passes
  • pnpm build produces static/index.js
  • pnpm test -- 9/9 tests pass
  • Test with a real BAM file in Galaxy

dannon added 25 commits March 18, 2026 15:40
Scope webr as @galaxyproject/webr and remove private:true for
consistency with all other packages. Replace hardcoded yarn calls
in alignmentviewer and annotateimage build scripts with generic
equivalents that work under any package manager.
pnpm workspaces will manage all dependencies from the root lockfile,
so these per-package lock files are no longer needed.
Replace lerna.json and yarn.lock with pnpm-workspace.yaml and
pnpm-lock.yaml. Root package.json now has pnpm convenience scripts
(build:all, test:all, lint:all, clean) and the packageManager field
set to pnpm@10.12.1. All 48 workspace packages resolve successfully.
All 30 per-package prettier.config.js files were byte-identical.
Moved the shared config to root and added a .prettierignore. Removed
the explicit --config flags from 7 package prettier scripts since
prettier will find the root config automatically.
Switch from per-package npm install to root-level pnpm install with
frozen lockfile. Replace npm/npx commands with pnpm equivalents.
Update cache strategy to use pnpm store instead of per-package
node_modules. Bump to Node 22.
publish-packages.yml triggers on push to main, detects package.json
version changes, and publishes updated packages to npm under the
@galaxyproject scope. manual-publish.yml provides a workflow_dispatch
for publishing individual packages with dry-run support.
Add repository structure, pnpm development setup commands, publishing
workflow documentation, and contributing guidelines.
setup-node@v5 tries to detect and cache the package manager on setup,
so pnpm needs to be installed first. Also bumped pnpm/action-setup
from v4 to v5 (latest).
entire BAM file and decompress it if it's gzipped.  Otherwise galaxy
blows up on range requests.
Adopt the shared vite.config.charts.js pattern so build outputs to
./static/ instead of ./static/dist/. Remove unused axios and pako
dependencies -- axios was imported but never used (all fetches use
fetch()), and pako's decompressed output was computed but never
consumed since @gmod/bam handles BGZF internally.

Also: remove per-package prettier config (now root-level), fix XML
entry_point path, fix test script to use --run instead of watch mode,
and add test cases for flag edge cases, quality score array conversion,
error rendering, and empty records.
@dannon dannon changed the title Bamjs Add bamjs BAM file viewer Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant